# coding: utf-8

from app.json.mysql.base import Base as BaseJson
from app.model.mysql.user import User as UserModel
from common.libs.user.UserLibs import UserLibs


class User(BaseJson):
    def __init__(self, model: UserModel):
        self.uid = model.uid
        self.email = model.email
        self.nickname = model.nickname
        self.token = UserLibs.geneAuthCode(model) + "#" + str(model.uid)
        self.icon = model.icon
